package io.gitee.thinkbungee.crud.mongo.criteria;

import org.springframework.data.mongodb.core.query.Criteria;

/**
 * @author chenyichang
 * @date 2022/5/11
 */
public class CriteriaOrWrapper extends CriteriaWrapper {

    public CriteriaOrWrapper() {
        this.andLink = false;
    }

    public CriteriaOrWrapper or(Criteria criteria) {
        this.list.add(criteria);
        return this;
    }

    public CriteriaOrWrapper or(CriteriaWrapper criteriaWrapper) {
        list.add(criteriaWrapper.build());
        return this;
    }
}
